package com.xmzgxcl.java202108.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @Author venky-ming
 * @Date 2021/12/24 9:56
 */
@Aspect
@Component
public class LogAdvice {
    @After(value = "execution(* com.xmzgxcl.java202108.service..*.*(..))")
    public void log(JoinPoint JoinPoint){
        String name = JoinPoint.getSignature().getName();
        Object[] args = JoinPoint.getArgs();
        System.out.println("LogAdvice.log");
        System.out.println("The method"+name+"  Parameter:"+ Arrays.asList(args));
    }
}
